﻿import mx.utils.Delegate;
/**
 * ...
 * @author wangjun
 */
class cn.eminia.A2.ui.selBox  extends MovieClip
{
	
	var gou:MovieClip;
	var onYes:Function;
	var onNo:Function;
	var sel:Number; 	// sel 只能存，不能取
	var _sel:Boolean; 	// _sel 既可以存，也可以取
	var onUnchange:Function;
	public function selBox() 
	{ 
		this.gou._visible = (_sel==null)?false:Boolean(_sel);
		this.onPress = function() {
			if (this.onUnchange) { 
				this.onUnchange();
				return;
			}
			if ( !gou._visible ) {
				gou._visible = true;
				sel = 1;  
				_sel = true;
				this.onYes();
			} else {
				gou._visible = false;
				sel = 0; 
				_sel = false;
				this.onNo();
			}
		}; 
	}
	public function doTurn() {
		this.onPress();
	}
	public function doSel() {
		trace('here')
		gou._visible = true;	
	}
}